<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>微信支付</title>
    <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
    <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <!--http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js-->
</head>
<style>
    *{
        margin: 0px;
        padding: 0px;
    }
</style>

<body>
     <div id="big" style="position: relative;">
        <div style="position: absolute;top: 35%;width: 100%;text-align: center">正在加载中，请稍等...</div>
        <div  style="position: absolute;top: 40%;width: 100%;text-align: center">如未弹出支付框，请点击返回按钮后重试。</div>
        <div id="clickgo"  style="position: absolute;top: 50%;width: 40%;left: 30%;text-align: center;height: 50px;line-height: 50px;border-radius: 25px;background-color: #09BB07;color: white;font-weight: bold;">返回</div>
    </div>
</body>
<script type="text/javascript">


    $(function () {
        var new_http = GetQueryString("new_http");
        var money_buy =GetQueryString("money");
        var givemoneys = GetQueryString("gitMoney");
        var heights = $(window).height();
//        alert(new_http);
        $("#big").height(heights);
        $("#clickgo").click(function () {
            window.location.href = "http://" + new_http + "/footballgame/index.html";
        });
        // alert(GetQueryString("money"));
        // alert(GetQueryString("money_give"));

        //支付成功
        // alert('支付成功');

        $.ajax({
            url: "/foot/user/setBalanceMoney?money=" + money_buy + "&gitMoney=" + givemoneys,
            type: 'post',
            dataType: 'json',
            success: function (res) {
                if (res.error_code == 0) {
                    alert("充值成功");
                    window.location.href = "http://" + new_http + "/footballgame/index.html";
                } else {
                    alert("充值失败");
                    window.location.href = "http://" + new_http + "/footballgame/index.html";

                }
            },error:function (res) {
                alert(res.data);
            }
        })
    })


    // 获取地址参数
    function GetQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]); return null;
    }

</script>

</html>